<?php
/**
 * XGPHP 轻量级PHP框架
 * @link http://xgphp.xg3.cn
 * @version 2.0.0
 * @license http://www.apache.org/licenses/LICENSE-2.0
 * @author 讯高科技 <xungaokeji@qq.com>
*/
namespace xg\response;

class Json extends \xg\Response {
	protected $json_encode_options = JSON_UNESCAPED_UNICODE;
	
	public function pretty() {
		$this->json_encode_options = $this->json_encode_options | JSON_PRETTY_PRINT;
		return $this;
	}
	
	protected function output() {
		$this->contentType('application/json');
		return json_encode($this->content, $this->json_encode_options);
	}
}
?>